import loadable from "react-loadable";
import { Loading } from 'antd-mobile/2x'
const loader = (loader, loading = () => <div style={{ fontSize: 28, width: "100vw", height: "100vh", display: "flex", justifyContent: "center", paddingTop: "30%" }}>
    <Loading />
</div>) => {
    return loadable({
        loader,
        loading
    })
}

const routerList = [{
    path: "/login",
    component: loader(() => import("../pages/login/index")),
    name: "Login"
}, {
    path: "/index",
    component: loader(() => import("../pages/index/index")),
    name: "Index",
    children: [{
        path: "/index/home",
        component: loader(() => import("../pages/index/home/index")),
        name: "Home"
    }, {
        path: "/index/room",
        component: loader(() => import("../pages/index/room/index")),
        name: "Room"
    }, {
        path: "/index/my",
        component: loader(() => import("../pages/index/my/index")),
        name: "My"
    }, {
        from: "/index",
        to: "/index/home"
    }]
}, {
    path: "/city",
    component: loader(() => import("../pages/index/city/index")),
    name: "City"
}, {
    path: "/homeList",
    component: loader(() => import("../pages/index/recordHomeList/index")),
    name: "News"
}, {
    path: "/map",
    component: loader(() => import("../pages/map/index")),
    name: "Map"
}, {
    path: "/details",
    component: loader(() => import("../pages/detail/index")),
    name: "Details"
}, {
    path: "/setUser",
    component: loader(() => import("../pages/setUser/index")),
    name: "SetUser",
    isLogin: true,
}, {
    path: "/housesAdd",
    component: loader(() => import("../pages/lease/index")),
    isLogin: true,
    name: "HousesAdd"
},
{
    path: "/search",
    component: loader(() => import("../pages/search/index")),
    isLogin: true,
    name: "Search"
}, {
    path: "/myRoom",
    component: loader(() => import("../pages/myRoom/index")),
    isLogin: true,
    name: "MyRoom"
},
    , {
    path: "/recordHomeList",
    component: loader(() => import("../pages/index/recordHomeList/index")),
    isLogin: true,
    name: "RecordHomeList"
}, {
    from: "/",
    to: "/index"
}]


export default routerList;

